package com.wps.wdztv6.api.request;

import com.alibaba.fastjson2.annotation.JSONField;
import lombok.*;

import java.util.ArrayList;

/**
 * 内容操作
 */
@Data
@Builder
public class OperateContentRequest {
    // 任务id
    @JSONField(name="task_id")
    private String taskId;

    // 图片地址
    @JSONField(name="doc_url")
    private String docUrl;

    // 图片名称，必须带后缀
    @JSONField(name="doc_filename")
    private String docFilename;

    private ArrayList<Step> steps;

    @Getter
    @Setter
    @ToString
    @Builder
    public static class Step{

        @JSONField(name="operate")
        private String operate;

        @JSONField(name="args")
        private Args args;

        @Getter
        @Setter
        @ToString
        @Builder
        public static class Args{

            @JSONField(name="clean_options")
            private ArrayList<String> cleanOptions;

            @JSONField(name="text_watermark")
            private TextWatermark textWatermark;
            @JSONField(name="image_watermark")
            private ImageWatermark imageWatermark;

            @Getter
            @Setter
            @ToString
            @Builder
            public static class TextWatermark{
                private String content;
                // 是否倾斜45度，默认false
                @JSONField(name="tilt")
                private Boolean tilt;
                @JSONField(name="size")
                private Integer size;
                @JSONField(name="color")
                private String  color;
                @JSONField(name="transparent")
                private Float transparent;
                @JSONField(name="position")
                private String position;
                // 水印是否平铺，默认false
                @JSONField(name="tiled")
                private Boolean tiled;
            }

            @Getter
            @Setter
            @Builder
            public static class ImageWatermark{
                @JSONField(name="watermark_url")
                private String watermarkUrl;

                @JSONField(name="watermark_filename")
                private String watermarkFilename;

                // 是否倾斜45度，默认false
                @JSONField(name="tilt")
                private Boolean tilt;

                @JSONField(name="transparent")
                private Float transparent;

                @JSONField(name="rotate")
                private Float rotate;

                @JSONField(name="position")
                private String position;

                @JSONField(name="tiled")
                private Boolean tiled;
                @JSONField(name="scale")
                private Float scale;
            }
        }
    }
}
